<div class="articles view">
	<h2><?php  echo __d('articles','Article');?></h2>
	<div class="clear"></div>
	<div class="actions selected">
		<?php 
			$domain_id = $article['Article']['domain_id']; if(!empty($domain_id)) echo $this->Html->link(__d('articles','Cancel'), array('controller'=>'domains','action' => 'view',$domain_id,'d'=>'articles'),array('style'=>'margin-right: 25px;'));
			echo $this->Html->link(__d('articles','Edit Article'), array('action' => 'edit', $article['Article']['id'],'d'=>$article['Article']['domain_id']),array('class'=>'action-left'));
			echo $this->Form->postLink(__d('articles','Delete Article'), array('action' => 'delete', $article['Article']['id'],'d'=>$article['Article']['domain_id']),array('class'=>'action-inner'), __d('articles','Are you sure you want to delete # %s?', $article['Article']['id']));
			echo $this->Html->link(__d('articles','Send Article'), array('action' => 'send', $article['Article']['id'],'d'=>$article['Article']['domain_id']),array('style'=>'margin-right: 25px;','class'=>'action-right'));
			echo $this->Html->link(__d('articles','New Post'), array('controller'=>'posts','action' => 'add','a'=>$article['Article']['id'],'d'=>$article['Article']['domain_id']),array('style'=>'margin-right: 25px;')); 
		?>
	</div>
	<div class="clear"></div>
	<dl>
		<dt><?php echo __d('articles','Title'); ?></dt>
		<dd>
			<?php echo h($article['Article']['name']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __d('articles','Keywords'); ?></dt>
		<dd>
			<?php echo h($article['Article']['keywords']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __d('articles','Descriptions'); ?></dt>
		<dd>
			<?php echo h($article['Article']['descriptions']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __d('articles','Custom meta'); ?></dt>
		<dd>
			<?php echo nl2br(h($article['Article']['metas'])); ?>
			&nbsp;
		</dd>
		<dt><?php echo __d('articles','Content'); ?></dt>
		<dd>
			<?php echo $article['Article']['content']; ?>
			&nbsp;
		</dd>
	</dl>

	<div class="related">
		<h3><?php echo __d('articles','Uploads');?></h3>
		
		<table cellpadding = "0" cellspacing = "0">
		<tr>
			<th><?php echo __d('articles','Id'); ?></th>
			<th><?php echo __d('articles','Name'); ?></th>
			<th><?php echo __d('articles','Modified'); ?></th>
			<th class="actions"><?php echo $this->Html->link(__d('articles','New File'), array('controller' => 'articles', 'action' => 'add_file','a'=>$article['Article']['id'],'d'=>$article['Article']['domain_id']));?></th>
		</tr>

		<?php if (!empty($article['Upload'])):?>
		<?php
			$i = 0;
			foreach ($article['Upload'] as $upload): ?>
			<tr>
				<td><?php echo $upload['id'];?></td>
				<td><?php echo $this->Html->image($this->FileUpload->image($upload['name'],array('width'=>150,'imagePathOnly'=>true)),array('alt'=>h($article['Article']['name']))); $this->Html->link($upload['name'],$upload['name']);?></td>
				<td><?php echo $upload['modified'];?></td>
				<td class="actions">
					<?php 
// 						echo $this->Html->link(__d('articles','View'), array('controller' => 'articles', 'action' => 'view_file', $upload['id'],'a'=>$article['Article']['id']),array('class'=>'action-left'));
// 						echo $this->Html->link(__d('articles','Edit'), array('controller' => 'articles', 'action' => 'edit_file', $upload['id'],'a'=>$article['Article']['id']),array('class'=>'action-inner'));
						echo $this->Form->postLink(__d('articles','Delete'), array('controller' => 'articles', 'action' => 'delete_file', $upload['id'],'a'=>$article['Article']['id']), array('style'=>'margin-right: 5px;'), __d('articles','Are you sure you want to delete # %s?', $upload['id'])); 
					?>
				</td>
			</tr>
		<?php endforeach; ?>
		<?php endif; ?>
		</table>
	

	</div>
	
	<div class="related">
		<h3><?php echo __d('articles','Posts');?></h3>
		
		<table cellpadding = "0" cellspacing = "0">
		<tr>
			<th><?php echo __d('articles','Id'); ?></th>
			<th><?php echo __d('articles','Name'); ?></th>
			<th><?php echo __d('articles','Autor'); ?></th>			
			<th><?php echo __d('articles','Domain'); ?></th>
			<th><?php echo __d('articles','Status'); ?></th>
			<th class="actions"><?php echo $this->Html->link(__d('articles','New Post'), array('controller' => 'posts', 'action' => 'add','a'=>$article['Article']['id'],'d'=> $article['Domain']['id']));?></th>
		</tr>

		<?php if (!empty($article['Post'])):?>
		<?php
			$i = 0;
			foreach ($article['Post'] as $post): ?>
			<tr>
				<td><?php echo $post['id'];?></td>
				<td><?php echo $post['name'];?></td>
				<td><?php echo $users[$post['user_id']];?></td>				
				<td><?php echo $this->Html->link($doamins[$post['domain_id']],'http://'.$doamins[$post['domain_id']]);?></td>
				<td><?php echo $post['status'];?></td>
				<td class="actions">
					<?php 
						echo $this->Html->link(__d('articles','View'), array('controller' => 'posts', 'action' => 'view', $post['id'],'a'=>$article['Article']['id']),array('class'=>'action-left'));
						echo $this->Html->link(__d('articles','Edit'), array('controller' => 'posts', 'action' => 'edit', $post['id'],'a'=>$article['Article']['id']),array('class'=>'action-inner'));
						echo $this->Form->postLink(__d('articles','Delete'), array('controller' => 'posts', 'action' => 'delete', $post['id'],'a'=>$article['Article']['id'],'d'=>$post['domain_id']), array('style'=>'margin-right: 5px;','class'=>'action-right'), __d('articles','Are you sure you want to delete # %s?', $post['id'])); 
					?>
				</td>
			</tr>
		<?php endforeach; ?>
		<?php endif; ?>
		</table>
	
	</div>
	
	<div class="related">
		<h3><?php echo __d('articles','Related Ratings');?></h3>
			
			<table cellpadding = "0" cellspacing = "0">
			<tr>
				<th><?php echo __d('articles','Id'); ?></th>
				<th><?php echo __d('articles','Group'); ?></th>
				<th><?php echo __d('articles','Name'); ?></th>
				<th class="actions"><?php echo $this->Html->link(__d('articles','Edit Rating'), array('controller' => 'articles', 'action' => 'edit_rating', $article['Article']['id']));?></th>
			</tr>

			<?php if (!empty($article['Rating'])):?>
			<?php
				$i = 0;
				foreach ($article['Rating'] as $rating): ?>
				<tr>
					<td><?php echo $rating['id'];?></td>
					<td><?php echo $rating_groups[$rating['rating_group_id']];?></td>
					<td colspan="2"><?php echo $rating['name'];?></td>
				</tr>
			<?php endforeach; ?>
			<?php endif; ?>
			</table>
		

		</div>
</div>
<?php echo $this->element('/menu/left')?>